package linguaggio;

/**
 * La classe contiene le informazioni relative ai token quali:
 * tipo, eventuale espressione regolare, nome;
 * @author valerio, Maxi Lopez
 */
public class Token extends Element{

    private String expression;
    
    private String code;

    public Token(){
        
    }
    public Token(String name, String expression) {
        super(name);
        this.expression = expression; 
    }

    public Token(String name, String expression, AttributeType.tokenType thisTokenType) {

        this(name, expression);
        super.setThisTokenType(thisTokenType);
        
    }
    public Token(String name, String expression, AttributeType.tokenType thisTokenType, String typeAttribute) {

        this(name, expression,thisTokenType);
        super.setTypeAttribute(typeAttribute);
        
    }
    public Token(String name, String expression, AttributeType.tokenType thisTokenType, String typeAttribute, String code) {

        this(name, expression,thisTokenType,typeAttribute);
        this.code = code;
    }
    public String getExpression() {
        return expression;
    }

    public void setExpression(String expression) {
        this.expression = expression;
    }

        public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

}
